# 1、任何一个业务都可以写成4种实现，至于你用哪种，根据业务灵活判断
def total():
    result = 0
    for i in range(1, 101):
        result = result + i
    print(f'他们的和为：{result}')


total()


def total2(start, end):
    result = 0
    for i in range(start, end):
        result = result + i
    print(f'他们的和为：{result}')


total2(1, 101)


def total3():
    result = 0
    for i in range(1, 101):
        result = result + i
    return result


total = total3()
print(f'他们的和为：{total}')


def total4(start, end):
    result = 0
    for i in range(start, end):
        result = result + i
    return result


total = total4(1, 101)
print(f'他们的和为：{total}')
